//  不要给我WA WA 叫
//  一定AC
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <iomanip>
#include <climits>
#include <cmath>
#define int unsigned long long 
#define x first 
#define y second 
using namespace std;
const int N = 1e5 + 10;
//int a[N];
int qmi(int a,int b,int p)
{
    int res=1%p;
    while(b)
    {
        if(b&1) res=res*a%p;
        a=a*a%p;
        b>>=1;
    }
    return res;
}
void solve()
{
     int a,b,x;
     cin >> a >> b >> x;
     cout << qmi(a,b,pow(10,x)) << endl;
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int t = 1;
    while(t -- )  solve();
    return 0;
}